<!DOCTYPE html>
<html lang="zh-CN" xmlns:th="http://www.thymeleaf.org">
<head>
  <meta charset="UTF-8">
  <title>Login</title>
  <script src="https://cdn.bootcdn.net/ajax/libs/vue/2.6.11/vue.js"></script>
</head>
<body>
  <div id="app">
    <form action="javascript:;">
      <p>username: <input v-model="name"/></p>
      <p>password: <input v-model="pwd"/></p>
      <button @click="handleLogin">LOGIN</button>
    </form>
  </div>

<script>
  new Vue({
    el: '#app',
    data: {
      name: '',
      pwd: ''
    },
    methods: {
      handleLogin() {
        fetch(`http://localhost:18080/hello/login?name=${this.name}&pwd=${this.pwd}`);
      }
    }
  })
</script>
</body>
</html>